package cn.edu.scau.cmi.yanghaorui.client;

import java.util.Scanner;

import cn.edu.scau.cmi.yanghaorui.simpleFactoryMethod.MeatFactory;
import cn.edu.scau.cmi.yanghaorui.simpleFactoryMethod.domain.Meat;

public class SimpleFactoryMethodClient {

	public static void main(String[] args) {
		char c = '0';
		while(true) {
			System.out.println("请输入您想生产的肉类：1.生产牛肉 2.生产猪肉 3.生产鸡肉 4.退出");
			Scanner sc = new Scanner(System.in);
			c =sc.next().charAt(0);    
			if(c=='1') {
				Meat beaf = MeatFactory.getMeat("beef");
				beaf.cook();
			}
			else if(c=='2') {
				Meat pork = MeatFactory.getMeat("pork");
				pork.cook();
			}
			else if(c=='3') {
				Meat chicken = MeatFactory.getMeat("chicken");
				chicken.cook();
			}
			else if(c=='4'){
				System.out.println("退出生产！");
				break;
			}
			else {
				System.out.println("无效输入，请重新输入！");
			}
		}

	}
	

}
